Introduction

    In this lab you are going to learn how to connect to use Azure Lab Service, use Hyper-V to create a Linux virtual machines and you are going to have an introduction to Linux.

    Connect to Azure Lab Services
  1. Log into your email. You will have received an email from Microsoft Azure about registering for the CO4509 lab.

  2.  
  3. Click the 'Register for the lab' link. It will take you to a web site where you will be registered the for the lab.

  4.  
  5. If the virutal machine isn't already started click start. This will take a few minutes if the Azure Lab services machine isn't already running.

  6.  
  7. Once the Azure Lab services virtual machine is running click on the three dots and then click reset password.

  8.  
  9. Set a new password.

  10.  
  11. Click the icon of a computer. This downloads the connection file. Once it has downloaded click on it to connect your Azure Lab Services virtual machine.

  12.  
  13. Click through any popups. And enter your password if prompted.

  14.  
    Setup Windows
  15. When you first connect you will have to finish the installation of Windows. Click Accept

  16.  
  17. Click yes.

  18.  
    Installing Linux in Hyper-V
  19. In the Windows search bar type hyper-v. Once Hyper-V Manager is shown click on it.

  20.  
  21. Once Hyper-V has loaded click on the Hyper-V Manager. In my case this was ML-REFVM-435496.

  22.  
  23. Select Action, then Quick Create.

  24.  
  25. Select Ubuntu 18.04 LTS and click Create Virtual Machine.

  26.  
  27. Once the Virtual machine has been created click connect

  28.  
  29. You now need to finish the Linux installation. Select English and click Continue.

  30.  
  31. Select the appropiate keyboard map. The lab uses English (UK) and English (UK).

  32.  
  33. Set your location as London, this sets the timezone for the computer.

  34.  
  35. Fill in your details to create a new account on the Linux computer. For the password I used Pa55word. You should make sure you set a password that you can remember.

  36.  
  37. Once the installation has finished click the nine dots at the bottom left and type in terminal.

  38.  
  39. You should be left with a terminal as shown below. This will let you enter various Unix commands.

  40.  
    Learning Linux
  41. Many of the commands in Linux are very terse and initially seem to be not particularly intuitive. You might need some time to become accustomed to them and perhaps a little longer still to appreciate their great power. One of the most useful commands is man. It gives the man(ual) pages for specified commands.
    • pwd
    • ls
    • cd
    • mkdir
    • cp
    • mv
    • rm
    • rmdir
    • cat
    • more
    • less
    • df
    • du
    • wc
    • sort
    • diff
    • find
    • whereis
    • nslookup
    • man

    Look at the man pages for these commands by typing man then the command in a terminal window e.g. man pwd (use the space bar to scroll down, q to quit). Make brief notes. Explain the difference between more and less

  42.  
  43. What is your current working directory?
  44.  
  45. Create a new directory and change to it.
  46.  
  47. Create another directory called Practice and change to this new directory.
  48.  
  49. Use an editor to create a text file of about 20 lines in this directory.
  50.  
  51. What happens if you type the following?

    cd ..

  52.  
  53. Keep typing the above command and check the name of the directory each time.
  54.  
  55. Change to your home directory.

    What does ls -l show?

    What does ls -al show?

  56.  
  57. List your text file to the screen.
  58.  
  59. Sort the file and list it to the screen.
  60.  
  61. Sort the file and write the output to a new file.
  62.  
  63. Move the sorted file to your home directory.
  64.  
  65. Copy the file to your Practice directory.
  66.  
  67. What happens if you type the following?

    rm -i *

  68.  
  69. What would happen if you typed the following (don't do it)?

    rm *

  70.  
  71. What does the following show?

    df

  72.  
  73. Type cd /. Where are you?
  74.  
  75. Type ls. What do you see?
  76.  
  77. What is in /bin?
  78.  
  79. What is in /etc?
  80.  
  81. What is in /dev?
  82.  
  83. What does the command grep do?
  84.  
  85. What does the command chmod do?
  86.  
  87. Change the protections on the file that you created so that no-one else can access it (except the root superuser who can bypass all protections).
  88.  
  89. What does the command apropos do?
  90.  
  91. Find out how you would list the differences between two similar files. Try it.
  92.  
  93. What does the command firefox do?
  94.  
  95. What is the name of the directory containing your configuration files for firefox?
  96.  
  97. What command, if you typed it accidentally as the root superuser, would delete the entire operating system?
  98.  
  99. What happens if you type the following?

    ls -l | wc

  100.  
  101. What is the function of the vertical line $|$ in the above command?
  102.